using HCore.IOC.Beans.Factory.Attribute.Attr;
using HCore.Unity.Behaviour;
using HCore.Unity.Core;
using UnityEngine;

namespace UI.UIGame.Menu
{
    /// <summary>
    ///     返回中心点的按钮控制器
    /// </summary>
    public class BackCenterPosition : HCoreMonoBehaviour
    {
        [Autowired] private UIGameService aUIGameService;
        private FunctionUpdater mFunctionUpdater;


        private void Start()
        {
            Get().Button.onClick.AddListener(aUIGameService.BackToPuzzleStartPoint);
            mFunctionUpdater = GameUtils.CreateKeyCodeAction(KeyCode.E, aUIGameService.BackToPuzzleStartPoint);
        }

        protected override void OnDestroy()
        {
            mFunctionUpdater?.DestroySelf();
            base.OnDestroy();
        }
    }
}